<%@page import="com.bms.entity.Publisher"%>
<%@page import="java.util.List"%>
<%@page import="com.bms.dao.PublisherDao"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>
      图书管理信息系统-出版社管理
    </title>
    <link rel=stylesheet href="../inc/main.css" type="text/css">
    <style type="text/css">
    </style>
  </head>
  <body>
    <%@include file="/inc/head.jsp"%>
    <table align="center" width="980">
      <tr>
        <td align="right">
          <a 
              href="#"
              onclick="window.open('<%=request.getContextPath() %>/publishers/add.jsp', '', 'width=280,height=130')">

            添加出版社
          </a>
        </td>
      </tr>
    </table>
    <table align="center" width="980">
      <caption>
        出版社列表
      </caption>
      <tr>
        <th width="200">
          出版社ID
        </th>
        <th width="550">
          出版社名称
        </th>
        <th width="230">
          操作
        </th>
      </tr>
      <%
      PublisherDao dao=new PublisherDao();
      List<Publisher> publishers=dao.queryAll();
      if(publishers!=null&&publishers.size()>0){
        for(int i=0;i<publishers.size();i++){
          Publisher publisher=publishers.get(i);
          %>
          <tr>
            <td>
              <%=(i+1) %>
            </td>
            <td>
              <%=publisher.getName() %>
            </td>
            <td align="center">
              <a 
                  href="<%=request.getContextPath() %>/publisherAction?method=delete&id=<%=publisher.getId()%>"
                  onclick="return confirm('是否确认删除该信息！');">

                删除
              </a>
              <a 
                  href="#"
                  onclick="window.open('<%=request.getContextPath() %>/publishers/edit.jsp?id=<%=publisher.getId()%>', '', 'width=280,height=130')">

                修改
              </a>
            </td>
          </tr>
          <%
        }
      }else{
        %>
        <tr>
          <td colspan="3" align="center">
            		没有任何出版社信息
          </td>
        </tr>
        <%
      }
      %>
    </table>
  </html>
